<?php
/**
 * Created by PhpStorm.
 * User: user
 * Date: 2020/6/15
 * Time: 10:49
 */
/**
 * @property CI_Loader $load load class
 * @property CI_Benchmark $benchmark                This class enables you to mark points and calculate the time difference between them.<br />  Memory consumption can also be displayed.
 * @property CI_Lang $lang                          Language Class
 * @property Activity_model $Activity_model
 * @property Users_model $Users_model
 * @property League_model $League_model
 * @property Medal_model $Medal_model
 * @property Prop_model $Prop_model
 * @property Activity_service $Activity_service
 * @property Logs
 */
class MY_Service
{
    public function __construct()
    {
        error_reporting(E_ALL ^ E_NOTICE);
    }
    function __get($key)
    {
        $CI = & get_instance();
        return $CI->$key;
    }

    /**
     * @param $code
     * @param string $message
     * @param array $data
     * @return array
     */
    function serviceResponse($code, $message = '', $data = '') {
        if($data == ''){
            $data = [];
        }
        return [
            'code' => $code,
            'message' => $message,
            'data' => $data
        ];
    }
}